<script>
    var empty=[];
    var arr=[56,54,21,35,69,36,58,47];
    for (let i = 0; i <arr.length; i++) {
       for (let j = 0; j < arr.length-1; j++) {
        if (arr[j]>arr[j+1]) {
            var temp=arr[j];
            arr[j]=arr[j+1];
            arr[j+1]=temp;
        }
       }
    }
    alert(arr);
</script>